package ch.evaleto.gwt.media.client.player;

public class PlayerManager {
	protected static Player instance;
	
	public static Player get() {
//		if (instance==null)
//			throw new PlayerException("Could not find player instance");
		return instance;
	}

	/**
	 * set by the player implementation
	 * @param instance
	 */
	public static void set(Player instance) {
		PlayerManager.instance=instance;
	}
	
	public static String format(int sec) {
		int minutes = (sec / 60);
		int seconds = (sec - minutes) % 60;
		return minutes + ":" + (seconds < 10 ? "0" + seconds : "" + seconds);
	}
	
}
